package info.techgeek.labs.java5Features.autoBoxing;

import java.util.ArrayList;
import java.util.List;

public class CodeExample {

	public static void main(String args[]){
		
		CodeExample codeExample = new CodeExample();
		
//		codeExample.boxItPrimitive();
//		codeExample.boxItPrimitiveValOf();
//		codeExample.boxing();
		
		int i =10;
		Integer integer1 =10;
		Integer integer2 =new Integer(10);
		System.out.println( integer1==integer2);
	}

	public void boxItPrimitive()
	{
		int first = 1; 
		int second = 2; 
		int third = 3; 
		ArrayList listONumbers = new ArrayList(); 
		listONumbers.add(first); 
		listONumbers.add(second); 
		listONumbers.add(third); 
		for(int i=0; i< listONumbers.size(); i++)
		{ 
			System.out.println(listONumbers.get(i)); 
		} 
	}
	
	public void boxItPrimitiveValOf()
	{
		int first = 1;
		int second = 2;
		int third = 3;
		ArrayList listONumbers = new ArrayList();
		listONumbers.add(Integer.valueOf(first));
		listONumbers.add(Integer.valueOf(second));
		listONumbers.add(Integer.valueOf(third));
		for(int i = 0; i < listONumbers.size(); i++)
		{
			System.out.println(listONumbers.get(i));
		}
	}

	public void boxing(){
		
		List<Integer> list = new ArrayList<Integer>();

		list.add(1);
		list.add(null);

		for(int i:list) 
		System.out.println(i);

	}
		
}
